<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'admin_list2.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet" type="text/css" href="css/table.css">
<link rel="stylesheet" type="text/css" href="css/emp_add.css">
<script type="text/javascript">
function confirmDel( message ){
	if( message == null ){ 
		message = "您确定要删除一条记录吗？";
	}
	if( window.confirm( message ) ){
		$.blockUI({ 
			message: '<p style="font-size: 16px;font-weight: bold;">正在执行，请稍候...</p>' 
		});
		return true;
	}else{
		return false;
	}
}
</script>
</head>
<body>
	<table>
		<caption>所有管理员</caption>
		<thead>
			<tr>
				<th>管理员ID</th>
				<th>用户名</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody id="tab">

			<s:iterator value="adminList" var="admin">
				<tr>
					<td><s:property value="#admin.admin_id" /></td>
					<td><s:property value="#admin.admin_name" /></td>


					<td><a onclick="return confirmDel('确定要删除此管理员吗？')"
						href="adminAction!delAdmin.action?admin.admin_id=<s:property value="#admin.admin_id" />">[删除]</a>
						<a 
						href="adminAction!showUpdateAdmin.action?admin.admin_id=<s:property value="#admin.admin_id" />">[修改密码]</a>
					</td>
				</tr>
			</s:iterator>
		<tfoot>
			<tr>
				<td colspan="3">管理员不能删除自己</td>
			</tr>
		</tfoot>

		</tbody>
	</table>

	<h3>添加管理员</h3>
	<div id="container">
		<form id="fm-form" method="post" action="adminAction!addAdmin.action">
			<fieldset>
				<legend>个人信息</legend>
				<div class="fm-req">
					<label for="fm-firstname">账户名</label> <input
						name="admin.admin_name" id="fm-firstname" type="text">
				</div>
				<div class="fm-req">
					<label for="fm-firstname">密码</label> <input
						name="admin.admin_password" id="fm-firstname" type="password">
				</div>
				<div class="fm-req">
					<label for="fm-firstname">再次输入密码</label> <input
						name="admin.re_password" id="fm-firstname" type="password">
				</div>
			</fieldset>


			<div id="fm-submit" class="fm-req">
				<input name="Submit" value="&#25552; &#20132;" type="submit">
			</div>
			<br>
		</form>
	</div>
</body>
</html>